import request from '@/utils/request';

/**
 * 测震和前兆台站统计
 */
export const fetchStationCount = () => {
  return request({
    url: 'mobile/station/stationCount',
  });
};

export const fetchStations = (params: any) => {
  return request({
    url: 'mobile/station/list',
    params,
  });
};

/**
 * 前兆台站以及列表搜索
 */
export const fetchOmenStations = (params: any) => {
  return request({
    url: 'mobile/station/omenQueryList',
    params,
  });
};

// 运行率列表
export const getDayRunRateList = (params: any) => {
  return request({
    url: '/newRunLogStatistics/dayRunRateList',
    params,
  });
};

// 导出
export function exportDayList(data: any) {
  return request({
    url: '/newRunLogStatistics/exportDayList',
    method: 'post',
    responseType: 'blob',
    data,
    fetchOptions: {
      noEncoded: true,
    },
  });
}

// 运行率列表-明细报表
export const getDayRunRate = (params: any) => {
  return request({
    url: '/runLogStatistics/dayRunRate',
    params,
  });
};

// 导出-明细报表
export function exportMonthList(data: any) {
  return request({
    url: '/runLogStatistics/exportMonthList',
    method: 'post',
    responseType: 'blob',
    data,
    fetchOptions: {
      noEncoded: true,
    },
  });
}

// 服务延时统计列表
export const getList = (startTime: any, endTime: any, params: any) => {
  return request({
    url:
      '/heartBeatStatistics/getDeviceTimeDelayStatisticsList/' +
      startTime +
      '/' +
      endTime,
    method: 'get',
    params,
  });
};

// 获取详情
export function getDetailList(data: any) {
  return request({
    url: '/heartBeatStatistics/getTimeDelayDetailList',
    method: 'post',
    data,
  });
}

// 获取项目详情
export function getProjectDetailList(data: any) {
  return request({
    url: '/heartBeatStatistics/getTimeDelayDetailProjectCount',
    method: 'post',
    data,
  });
}
